#include "core.h"
#include "pluginmanager.h"
#include "pluginmodel.h"

static Core *inst{nullptr};

Core::Core(QObject *parent) : QObject(parent) {
  inst = this;

  pluginManager = new PluginManager(this);
  pluginManager->loadPlugins();

  pluginModel = new PluginModel(pluginManager, this);
}

Core::~Core() { inst = nullptr; }

Core *Core::instance() { return inst; }

PluginManager *Core::getPluginManager() const { return pluginManager; }

QAbstractItemModel *Core::getPluginModel() const { return pluginModel; }
